﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>
<jsp:include page="/comm/header_main.jsp" />

<script>
$(function(){
	var obj = $("[name='broker']");
	for(var i in obj){
		obj.eq(i).bind("click", function(){
			var p = $(this).attr("p");
			var userId = p.slice(0, -1);
			var flag = p.slice(-1);
			follow(userId, flag);
		});
	}
	
	$("#new_daigou").click(newDaiGou); 
	
	$("#new_qiougou").click(newQiouGou); 
	
	$("[name=want]").live("click", function() {
		var p = $(this).attr("p").split("|");
		wUserId = p[0];
		wantId = p[1];
		wantBuy();
	});
	
	$("[name=rade]").live("click", function() {
		var p = $(this).attr("p").split("|");
		wUserId = p[0];
		wantId = p[1];
		radeBuy();
	});
}); 

<%-- var bLogin = false;href="<%=path%>/invite.htm?id=${wantId}" href="<%=path%>/rideBuy.htm?id=${wantId}"
var fUserId = 0;

var doLogin = function(){
	var mail = $("#amail").val();
	var pwd = $("#apwd").val();
	
	if(!mail && !pwd){
		$("#msg").html("<font color='red'>请输入您的登录邮箱和密码</font>");
		return;
	}
	
	if(!mail){
		$("#msg").html("<font color='red'>请输入您的登录邮箱</font>");
		return;
	}
	
	if(!pwd){
		$("#msg").html("<font color='red'>请输入您的密码</font>");
		return;
	}
	
	$.ajax({
		type:"POST",
		url:"aLogin.htm",
		data:{email:mail, pwd:pwd},
		datatype:"text",
		success:function(data){
			if(data == ""){
				$("#msg").html("<font color='red'>用户名或者密码错误!</font>");
			}else{
				bLogin = true;
				closeLogin();
				$("#welcome").html("您好，"+data+"&nbsp;&nbsp;<a style='color:#A10000' href='<%=path%>/logout.htm'>退出登录</a>");
				
				if(0==to){
					follow(fUserId, 3);
				}else if(1==to){
					newDaiGou();
				}else{
					newQiouGou();
				}
			}
	    }
	});
}; --%>

var follow = function(userId, flag){
	var userObj = "${sessionScope.user}";
	if(userObj == '' && !bLogin){
		to = 3;
		fUserId = userId;
		showLogin();
	}else{
		$.ajax({
			type:"POST",
			url:"follow.htm",
			data:{userId:userId, flag:flag},
			datatype:"text",
			success:function(data){
				if(3==flag){
					var array = data.split("|");
					for(var i in array){
						$("#"+array[i]).attr("p", array[i]+"2");
						$("#"+array[i]).children().attr("src", "images/bg_butb1.png");
						//$("#"+array[i]).html('<a id="'+array[i]+'" name="broker" p="'+p+'" style="cursor:pointer"><img src="images/bg_butb1.png" border="0"/></a>');  
					}
				}else{
					if(data == "true"){
						if(1==flag){
							$("#"+userId).attr("p", userId+"2");
							$("#"+userId).children().attr("src", "images/bg_butb1.png");
							//$("#"+userId).html('<a id="'+userId+'" name="broker" p="'+p+'" style="cursor:pointer"><img src="images/bg_butb1.png" border="0"/></a>');  
						}else{
							$("#"+userId).attr("p", userId+"1");
							$("#"+userId).children().attr("src", "images/bg_butb.png");
							//$("#"+userId).html('<a id="'+userId+'" name="broker" p="'+p+'" style="cursor:pointer"><img src="images/bg_butb.png" border="0"/></a>');
						}
					}
			    }
			}
		});
	}
};

var newDaiGou = function(){
	var userObj = "${sessionScope.user}";
	if(userObj == '' && !bLogin){
		to = 1;
		showLogin();
	}else{
		window.open("new_daigou.htm");
	}
};

var newQiouGou = function(){
	var userObj = "${sessionScope.user}";
	if(userObj == '' && !bLogin){
		to = 2;
		showLogin();
	}else{
		window.open("new_qiougou.htm");
	}
};

var wUserId = 0;
var wantId = 0;
var wantBuy = function(){
	var userObj = "${sessionScope.user}";
	if(userObj == '' && !bLogin){
		to = 10;
		showLogin();
	}else{
		if(wUserId==lUserId || wUserId=="${sessionScope.user.userid}"){
			alert("您不能代购自己发布的商品！");
			return;
		}
		if(type==1 || 1=="${sessionScope.user.userType}"){
			window.open("accountinit.htm?t=2");
			return;
		}else{
			alreadyInvite();
		}
	}
};

var alreadyInvite = function(){
	$.ajax( {
		url:'canInvite.htm',
		data:{"inviteModel.wantId":wantId},
		success:function(json) {
			if (json.ajaxMsg != null) {
				alert(json.ajaxMsg);
			}else{
				window.open("invite.htm?id="+wantId);
			}	
		}
	});
};

var radeBuy = function(){
	var userObj = "${sessionScope.user}";
	if(userObj == '' && !bLogin){
		to = 11;
		showLogin();
	}else{
		if(wUserId==lUserId || wUserId=="${sessionScope.user.userid}"){
			alert("您不能搭车求购自己发布的商品！");
			return;
		}
		alreadyRade();
	}
};

var alreadyRade = function(){
	$.ajax({
		url:'canRideBuy.htm',
		data:{"simpleBuyModel.wantBuyModel.wantId":wantId},
		success:function(json){
			if (json.ajaxMsg != null) {
				alert(json.ajaxMsg);
			} else {
				window.open("rideBuy.htm?id="+wantId);
			}
		}
	});
};
</script>

<div class="wrap0">
	<div class="wrap1">
    	<div class="mainmenu">
    		<div class="wrap_left">
            
            	<div id="mainNav">
                	<ul>
					<li><a href="<%=path%>/main.htm">首页</a></li>
                	<li><a target="_blank" href="<%=path%>/canBuyList.htm">代购信息</a></li>
                	<li><a target="_blank" href="<%=path%>/wantBuyList.htm">求购信息</a></li>
                	<li><a target="_blank" href="<%=path%>/broker.htm">代购经纪人</a></li>
                    </ul>
      			</div>
            
            </div>
        	<div class="clear"></div>
        </div>
    </div>
</div>

    
<!--第1部分开始  --> 
    <div class="wrap1">
    	<div class="blank1"></div>
        
    	<div class="top3">
        	<div class="wrap_left">
            	<div class="w_box1">
                	<DIV id=idContainer2 class=container>
		<TABLE id=idSlider2 border=0 cellSpacing=0 cellPadding=0>
		  <TBODY>
		<TR>
		<TD class=td_f><a href="#"><IMG  src="images/m01.jpg" width="685" height="296" border="0"></a></TD>
		<TD class=td_f><a href="#"><IMG src="images/m02.jpg" width="685" height="296" border="0"></a></TD>
		<TD class=td_f><a href="#"><IMG src="images/m03.jpg" width="685" height="296" border="0"></a></TD>
		<TD class=td_f><a href="#"><IMG src="images/m04.jpg" width="685" height="296" border="0"></a></TD>
		
		
		</TR>
		  </TBODY>
		</TABLE>
<UL id=idNum class=num></UL>
</DIV>
<SCRIPT> 
//new SlideTrans("idContainer", "idSlider", 3).Run();
///////////////////////////////////////////////////////////
var forEach = function(array, callback, thisObject){
 if(array.forEach){
  array.forEach(callback, thisObject);
 }else{
  for (var i = 0, len = array.length; i < len; i++) { callback.call(thisObject, array[i], i, array); }
 }
}
var st = new SlideTrans("idContainer2", "idSlider2", 4, { Vertical: false });
var nums = [];
//插入数字
for(var i = 0, n = st._count - 1; i <= n;){
 (nums[i] = f007("idNum").appendChild(document.createElement("li"))).innerHTML = ++i;
}
forEach(nums, function(o, i){
 o.onmouseover = function(){ o.className = "on"; st.Auto = false; st.Run(i); }
 o.onmouseout = function(){ o.className = ""; st.Auto = true; st.Run(); }
})
//设置按钮样式
st.onStart = function(){
 forEach(nums, function(o, i){ o.className = st.Index == i ? "on" : ""; })
}
//f007("idAuto").onclick = function(){
 //if(st.Auto){
  //st.Auto = false; st.Stop(); this.value = "自动";
 //}else{
  //st.Auto = true; st.Run(); this.value = "停止";
 //}
//}
//f007("idNext").onclick = function(){ st.Next(); }
//f007("idPre").onclick = function(){ st.Previous(); }
//f007("idTween").onchange = function(){
 //switch (parseInt(this.value)){
  //case 2 :
   //st.Tween = Tween.Bounce.easeOut; break;
  //case 1 :
   //st.Tween = Tween.Back.easeOut; break;
  //default :
   //st.Tween = Tween.Quart.easeOut;
 //}
//}
st.Run();
</SCRIPT>

					
					
              </div>
            </div>
            <div class="wrap_right">
            	<div class="w_box2">
                	<div class="homebut1"><a style="cursor:pointer" id="new_daigou"><span>发布<strong>代购</strong>信息</span></a></div>
                    <div class="homebut2" style="margin-top:10px"><a style="cursor:pointer" id="new_qiougou"><span>发布<strong>求购</strong>信息</span></a></div>
                    <div class="home_icon">
                        <div class="i"><img src="images/micon3.gif"/><br />正品保障</div>
                        <div class="i"><img src="images/micon4.gif"/><br />原单发票</div>
                        <div class="i"><img src="images/micon5.gif"/><br />价格透明</div>
                        <div class="i end"><img src="images/micon6.gif"/><br />终身服务</div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>

    </div>
<!--第1部分结束  --> 
	<div class="clear"></div>
<!--第2部分开始  --> 
    <div class="wrap1">

    	<div class="top3" style="margin-top:8px !important;margin-top:0px">
        
<!--左边开始  -->
        	<div class="wrap_left">
            	<div class="w_box1">
<!--选项卡开始--> 	
<div id="mainTabbox">
 	<div id="tabbox1">
		<ul>
			<li id="taba1" onMouseover="setTab('taba',1,3)" class="hover"><a>代购 - 热门</a></li>
			<s:iterator value="cateList">
			<li><a target="_blank" href="<%=path%>/daigou.htm?id=${categoryId}">${categoryName}</a></li>
			</s:iterator>
            <li class="more"><a target="_blank" href="<%=path%>/daigou.htm">更多..</a></li>
 		</ul>
 
	</div>
 	<div id="conten">
      <div class="tab_wrap1">
 		<div class="tab_show" id="con_taba_1">
        
        <!--列表开始-->
<div class="show_list1">
	<ul>
    	<!--循环开始-->
		<s:iterator value="canBuyList">
	    	<li style="margin-bottom:10px;">
	        	<span class="showpic1"><a target="_blank" href="<%=path%>/canBuyDetail.htm?id=${canId}"><img src="<s:property value='image200' />"/></a></span><br />
	            <span class="showtxt1"><a target="_blank" href="<%=path%>/canBuyDetail.htm?id=${canId}"><span class="show_list1_tt">${goodsName}</span></a><br /><span class="span1">价格：</span><span class="span2">￥${price}</span><br /><span class="span1">佣金：</span><span>￥${serviceFee}</span><span class="span1">　|　${areaName}</span><br /><span class="span1"><a href="brokerDetail.htm?id=<s:property value='user.userid' />" target="_blank"><s:property value='user.nickName' /></a></span><span class="span1">　|　已有<s:property value='transNum' />人代购</span></span>
	        </li>
    	</s:iterator>
        <!--循环结束-->
      
    </ul>
    <div class="clear"></div>
</div>  
         

        
        <!--列表结束-->
        
        
 		</div>
 		<div class="tab_show" id="con_taba_2">2
 		</div>
 		<div class="tab_show" id="con_taba_3">3
    	</div>
        
      </div>
 	</div>
 </div>
<!--选项卡结束-->             
              </div>
            </div>
<!--左边结束  --> 
       
<!--右边开始  -->
            <div class="wrap_right">
            	<div class="w_box2">
                	<div class="list_tt1">
                		<div class="wrap_left"><span class="span6">代购经纪人</span></div>
                   		<div class="wrap_right"><span class="more1"><a target="_blank" href="broker.htm">更多..</a></span></div>
                    	<div class="clear"></div>
                    </div>
                    <div class="right_listbox1">
                    
<!--经纪人排行榜选项卡开始 -->
<div id="tabbox3">
		<ul>
			<li id="tabc1" onclick="setTab('tabc',1,3)" class="hover"><a>总榜</a></li>
 		</ul>
 
</div>
 <div id="conten3">

 		<div class="tabc_show" id="con_tabc_1">
        
<!-- 经纪人列表开始 --> 

<div class="show_list3" style="_margin-top:10px;">

<!-- 循环开始 -->

	<s:iterator value="hotBrokerList">
		<li style="margin-bottom:10px;">
			<div class="wrap_left"><span class="showpic2"><a target="_blank" href="<%=path%>/brokerDetail.htm?id=${userid}"><a target="_blank" href="<%=path%>/brokerDetail.htm?id=${userid}"><img src="${photoUrl}"
					border="0" width="60" height="60"/></a></a></span></div>
			<div class="wrap_left">
     			<span class="showtxt2"><a target="_blank" href="<%=path%>/brokerDetail.htm?id=${userid}"><span>${nickName}</span></a><br /><img src="images/${starImg}" border="0"/><br />
     			<s:if test="followId==0">
     				<a id="${userid}" name="broker" p="${userid}1" style="cursor:pointer"><img src="images/bg_butb.png" border="0"/></a>
     			</s:if>
     			<s:else>
     				<a id="${userid}" name="broker" p="${userid}2" style="cursor:pointer"><img src="images/bg_butb1.png" border="0"/></a>
     			</s:else>
     			</span>
     		</div>
     		<div class="wrap_right">
		     	<span class="showtxt3">
				代购行业：<s:iterator value="cateList" status="status">
						<s:if test="#status.index<2">
						${categoryName}&nbsp;
						</s:if>
					</s:iterator><br />
		        代购区域：<s:iterator value="areaList" status="status">
						<s:if test="#status.index<2">
						${areaName}&nbsp;
						</s:if>
					</s:iterator><br />
		        关注：<span class="showtxt4">${followCount}</span>
		        </span>
        </div>
        <div class="clear"></div>
		</li>
	</s:iterator>


<!-- 循环结束 --> 
</div>

<!-- 经纪人列表结束 --> 
        
        
        
        </div>
        <div class="tabc_show" id="con_tabc_2">2</div>
        <div class="tabc_show" id="con_tabc_3">3</div>
</div>
        
        


<!--经纪人排行榜选项卡结束 -->           
                    
                    
                    	
                    </div>
                </div>
            </div>   
<!--右边结束  -->
            
            <div class="clear"></div>
        </div>

    </div>
    
 <!--第2部分结束  -->   
 
 <div class="clear"></div>
 <!--第3部分开始  --> 
    <div class="wrap1">
    	<div class="blank1"></div>
        
    	<div class="top3">

<!--左边开始  -->
        	<div class="wrap_left">
            	<div class="w_box3">
<!--选项卡开始--> 	
<div id="mainTabbox">
 	<div id="tabbox1">
		<ul>
			<li id="tabb1" onclick="setTab('tabb',1,3)" class="hover"><a>求购 - 最新</a></li>
			<s:iterator value="areaList">
			<li id="tabb2"><a target="_blank" href="<%=path%>/qiougou.htm?id=${areaId}">${areaName}</a></li>
			</s:iterator>
            <li class="more"><a target="_blank" href="<%=path%>/qiougou.htm">更多..</a></li>
 		</ul>
	</div>
 	<div id="conten2">
       <div class="tab_wrap2">
       
 		<div class="tab_show" id="con_tabb_1">
        
        <!--列表开始-->
<div class="show_list">
	<div class="show_list2_box1">
    	<!--循环开始-->
    	<s:iterator value="wantBuyList">
   
                <div class="show_list2_con">
        	<div class="wrap_left"><span class="span1">代购服务费：</span><span class="span2">￥${serviceFee}</span></div>
            <div class="wrap_left"><span class="span3"><a href="#">${areaName}</a> | <a target="_blank" href="<%=path%>/wantBuyDetail.htm?id=${wantId}">${goodsName}</a></span></div>
            <div class="wrap_right"><span class="box"><a name="want" p="${user.userid}|${wantId}" class="but01" style="cursor:pointer"><p>我来代购</p></a>&nbsp;<a name="rade" p="${user.userid}|${wantId}" class="but02" style="cursor:pointer"><p>搭车求购</p></a></span></div>
	            <div class="clear"></div>
        	</div>
    	</s:iterator>
        <!--循环结束-->

        <div class="clear"></div>

      
    </div>
    
</div>  
        
        
        <!--列表结束-->
        
 		</div>
        
 		<div class="tab_show" id="con_tabb_2">

 		</div>
 		<div class="tab_show" id="con_tabb_3">
        

        
    	</div>
        
       </div>
 	</div>
 </div>
<!--选项卡结束-->             
              </div>
            </div>
<!--左边结束  --> 



            <div class="wrap_right">
            	<div class="w_box2">
                	<div class="list_tt1">
                		<div class="wrap_left"><span class="span6">代购知识</span></div>
                   		<div class="wrap_right"><span class="more1"><a target="_blank" href="<%=path%>/help/help.jsp">更多..</a></span></div>
                    	<div class="clear"></div>
                    </div>
					<div class="right_listbox1">
<!--代购知识选项卡开始 -->
<div id="tabbox4">
		<ul>
			<li id="tabd1" onclick="setTab('tabd',1,3)" class="hover"><a>入门知识</a></li>
			<!-- <li id="tabd2" onclick="setTab('tabd',2,3)"><a>关税</a></li>  -->
			<!-- <li id="tabd3" onclick="setTab('tabd',3,3)" style="border:0"><a>注意事项</a></li>  -->
 		</ul>
 
</div>
 <div id="conten4">
 		<div class="tabd_show" id="con_tabd_1">

<!--文章列表开始 -->
<div class="list_txt1" style="margin-bottom:8px;">
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=8">海外代购要注意些什么?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=9">海外代购奶粉常见问题汇总</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=7">海外代购相关的关税知识</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=10">国内有的商品还有必要到海外代购吗?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=2">代购岛与其他代购网站有什么区别?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=3">代购岛的代购流程</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=4&item=1">怎样才能成为代购岛的代购经纪人?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=11">如何保证正品?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=12">可以线下交流购买吗?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=12">可以到经纪人指定的淘宝店铺购买吗?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=14">不同货币如何处理?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=13">退换货如何处理?</a></li>
<li><a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=13">维修、保养如何处理?</a></li>
</div>
<!--文章列表结束 -->
        
        </div>
<!--        <div class="tabd_show" id="con_tabd_2">2</div>  -->
<!--        <div class="tabd_show" id="con_tabd_3">3</div>  -->
</div>
        

<!--代购知识选项卡据结束--> 
					</div>
                
                
                </div>
            </div>
            <div class="clear"></div>
        </div>

    </div>
<!--第3部分结束  -->  

<div class="clear"></div>
<div class="blank1"></div>

<div class="wrap1">
<!--保障信息开始--> 
<div class="bottom1">

	<div class="wrap_left">
    	<div class="bottom_list1">
    		<span class="span4">交易保障</span><br />
       		<span class="span5">
<a target="_blank" href="<%=path%>/help/help.jsp?id=1&item=0">平台交易</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=1&item=1">价格透明</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=1&item=2">原始单据</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=1&item=3">认证经纪人</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=1&item=4">申诉渠道</a>
        	</span>
        </div>
        
        <div class="bottom_list2">
    		<span class="span4">新手上路</span><br />
       		<span class="span5">
<a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=0">帐户注册</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=1">了解代购岛</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=6">代购流程</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=9">搭车代购</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=2&item=10">法律法规</a>
        	</span>
        </div>
        
        <div class="bottom_list1">
    		<span class="span4">支付相关</span><br />
       		<span class="span5">
<a target="_blank" href="<%=path%>/help/help.jsp?id=3&item=0">支付宝支付</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=3&item=1">如何办理退款?</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=3&item=2">经纪人如何收款</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=3&item=3">常见支付问题</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=3&item=3">没有网上银行怎么办?</a>
        	</span>
        </div>
        
        <div class="bottom_list2">
    		<span class="span4">经纪学堂</span><br />
       		<span class="span5">
<a target="_blank" href="<%=path%>/help/help.jsp?id=4&item=0">哪些人可以做代购?</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=4&item=1">帐户注册</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=4&item=2">帐户认证</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=4&item=3">特色服务</a><br />
<a target="_blank" href="<%=path%>/help/help.jsp?id=4&item=8">成长之路</a>
        	</span>
        </div>
    
    </div>
    
    
    <div class="clear"></div>

</div>
<!--保障信息结束--> 
<!--底部图标开始--> 
 					<div class="home_icon2">
                        <div class="i"><img src="images/micon3.gif"/><p>正品保障</p>
                        <img src="images/micon4.gif"/><p>原单发票</p>
                        <img src="images/micon5.gif"/><p>价格透明</p>
                        <img src="images/micon6.gif"/><p>终身服务</p></div>
                    </div>
<!--底部图标结束--> 

</div>

<jsp:include page="/comm/bottom_main.jsp" />
